<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        //匹配规则 如果匹配 返回true 否则 flash
        var reg = /hello/;
        var str = 'hello marke';
        console.log(reg.test(str));

        var demo = prompt('不准输入空格');
        alert(!(/\s/.test(demo)));
    </script>
</head>
<body>

</body>
</html>